package com.example.volunteeroa.repository;

import com.example.volunteeroa.entity.Organization;
import com.example.volunteeroa.entity.Volunteer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Repository
public interface OrganizationRepository extends JpaRepository<Organization,Integer>, JpaSpecificationExecutor<Organization>{

//    @Query("select e from Organization e where e.orgID=?1")
//    List<Organization>findByOrgID(Integer orgId);
//
//    @Transactional
//    @Modifying
//    @Query(value="delete  from Organization  where orgID=?1",nativeQuery = true)
//    void deleteByOrgID(Integer orgID);
//    //通过组织名字删除一个组织的信息
//
//    @Modifying
//    @Transactional
//    @Query(value = "update Organization e set e.volunteerNum=?2 where e.orgID=?1")
//    void UpdateVolunteerNum(Integer orgID,Integer volunteerNum);
//    //修改该组织下志愿者数量

}
